package com.huage_05.lesson_04;

import java.text.ParseException;
import java.util.Date;

/*
    测试类
 */
public class DateReverseDemo {
    public static void main(String[] args) throws ParseException {
        Date date = new Date();
        String pattern = "yyyy年MM月dd日 HH:mm:ss";
        String time = DateUtils.dateToString(date, pattern);
        System.out.println("time = " + time);

        String timeStr = "2020-02-20 19:19:38";
        Date date1 = DateUtils.stringToDate(timeStr,"yyyy-MM-dd HH:mm:ss");
        System.out.println("date1 = " + date1);
    }
}
